﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace WF_QLThuVien.Entities.QuyDinh
{
    class CQuyDinh
    {
        private int m_soSachMuonToiDa;

        public int SoSachMuonToiDa
        {
            get { return m_soSachMuonToiDa; }
            set { m_soSachMuonToiDa = value; }
        }
        private int m_soNgayMuonToiDa;

        public int SoNgayMuonToiDa
        {
            get { return m_soNgayMuonToiDa; }
            set { m_soNgayMuonToiDa = value; }
        }
        private int m_soLanGiaHan;

        public int SoLanGiaHan
        {
            get { return m_soLanGiaHan; }
            set { m_soLanGiaHan = value; }
        }
        private double m_tienKyQuyToiThieu;

        public double TienKyQuyToiThieu
        {
            get { return m_tienKyQuyToiThieu; }
            set { m_tienKyQuyToiThieu = value; }
        }
        private double m_phiLamThe;

        public double PhiLamThe
        {
            get { return m_phiLamThe; }
            set { m_phiLamThe = value; }
        }
        private int m_soNgayMotLanGiaHan;

        public int SoNgayMotLanGiaHan
        {
            get { return m_soNgayMotLanGiaHan; }
            set { m_soNgayMotLanGiaHan = value; }
        }
        private double m_tienPhatTreHan;

        public double TienPhatTreHan
        {
            get { return m_tienPhatTreHan; }
            set { m_tienPhatTreHan = value; }
        }
        private int m_tienPhatMatSach;

        public int TienPhatMatSach
        {
            get { return m_tienPhatMatSach; }
            set { m_tienPhatMatSach = value; }
        }        
        
        public CQuyDinh()
        {
            m_phiLamThe = 0;
            m_soLanGiaHan = 0;
            m_soNgayMotLanGiaHan = 0;
            m_soNgayMuonToiDa = 0;
            m_soSachMuonToiDa = 0;
            m_tienKyQuyToiThieu = 0;
            m_tienPhatMatSach = 0;            
            m_tienPhatTreHan = 0;
        }
        
        public CQuyDinh(int soSachMuonToiDa, int soNgayMuonToiDa,
            int soLanGiaHan, double tienKyQuyToiThieu,
            double phiLamThe, int soNgayMotLanGiaHan,
            double tienPhatTreHan, int tienPhatMatSach)
        {
            m_phiLamThe = phiLamThe;
            m_soLanGiaHan = soLanGiaHan;
            m_soNgayMotLanGiaHan = soNgayMotLanGiaHan;
            m_soNgayMuonToiDa = soNgayMuonToiDa;
            m_soSachMuonToiDa = soSachMuonToiDa;
            m_tienKyQuyToiThieu = tienKyQuyToiThieu;
            m_tienPhatMatSach = tienPhatMatSach;
            m_tienPhatTreHan = tienPhatTreHan;
        }

        public CQuyDinh(DataRow r)
        {
            m_phiLamThe = double.Parse(r["PhiLamThe"].ToString());
            m_soLanGiaHan = int.Parse(r["SoLanGiaHan"].ToString());
            m_soNgayMotLanGiaHan = int.Parse(r["SoNgayMotLanGiaHan"].ToString());
            m_soNgayMuonToiDa = int.Parse(r["SoNgayMuonToiDa"].ToString());
            m_soSachMuonToiDa = int.Parse(r["SoSachMuonToiDa"].ToString());
            m_tienKyQuyToiThieu = double.Parse(r["TienKyQuyToiThieu"].ToString());
            m_tienPhatMatSach = int.Parse(r["TienPhatMatSach"].ToString());
            m_tienPhatTreHan = double.Parse(r["TienPhatTreHan"].ToString());
        }
    }
}
